<template>
  <div>
    <a-card :bordered="false">
      <s-table
        ref="table"
        :columns="columns"
        :data="loadData"
        :rowKey="(record) => record.clientId"
      />
    </a-card>
  </div>
</template>

<script>
import { STable, XCard, XDown } from '@/components'
import { historyList } from '@/api/modular/garden/sound'
export default {
  components: {
    XDown,
    XCard,
    STable,
  },

  data() {
    return {
      // 查询参数
      queryParam: {},
      // 表头
      columns: [
        {
          title: '设备名称',
          dataIndex: 'deviceName',
        },
        {
          title: '终端id',
          dataIndex: 'clientId',
        },
        {
          title: '同步结果',
          dataIndex: 'result',
        },
        {
          title: '同步状态',
          dataIndex: 'statusStr',
        },
        {
          title: '同步时间',
          dataIndex:'syncTime'
        }
      ],
      // 加载数据方法 必须为 Promise 对象
      loadData: (parameter) => {
        return historyList(Object.assign(parameter, this.queryParam)).then((res) => {
          if (res.data.length) {
            console.log(res.data)
          }
          return res.data
        })
      },
    }
  },

  methods: {
    
  },
}
</script>

<style lang="less">
.table-operator {
  margin-bottom: 18px;
}
button {
  margin-right: 8px;
}
</style>
